using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Wintellect.PowerCollections;

namespace Quiki
{
    [SuppressMessage ("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
    public class FileSet : IEnumerable<string>
    {
        public void Clear()
        {
            files.Clear();
        }

        public bool HasFile(string fileName)
        {
            return files.Contains(fileName);
        }

        public void RegisterFile(string fileName)
        {
            files.Add(fileName);
        }

        public IEnumerator<string> GetEnumerator()
        {
            List<string> sortedFiles = new List<string>(files);
            sortedFiles.Sort();
            return sortedFiles.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        private Set<string> files = new Set<string>();
    }
}